package com.gitee.llj.shiro.controller;

import com.gitee.llj.entity.sys.SysUser;
import com.gitee.llj.shiro.service.ISysModuleService;
import com.gitee.llj.tools.base.ResultModel;
import org.apache.shiro.SecurityUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>模块Controller</p>
 *
 * @Author llj
 * @Date 2018/5/10
 */
@RestController
@RequestMapping("/api/module")
public class SysModuleController {
    @Resource
    private ISysModuleService sysModuleService;

    /**
     * 查询菜单
     * @return
     */
    @RequestMapping("list")
    public ResultModel getSysModules(){
        SysUser currentUser= (SysUser) SecurityUtils.getSubject().getPrincipal();
        return sysModuleService.getSysModulesByUser(currentUser.getId());
    }
}
